--[[
	display相关属性
]]
local M = {}

function M.isGroup(g)
	if not g then
		return false
	end
	if type(g) ~= "table" then
		return false
	end
	if g.numChildren and (not g._ISREMOVE) then
		return true
	end

	return false
end

function M.isDisplayObj(obj)
	if not obj then
		return false
	end

	if type(obj) ~= "table" then
		return false
	end

	if (obj._properties) and (not obj._ISREMOVE) then
		return true
	end

	return false
end

function M.cleanGroups(obj, isNotRemoveSelf)
	if M.isGroup(obj) then
		if not isNotRemoveSelf then
			obj:removeSelf()
			obj = nil
		else

			for i = obj.numChildren, 1, -1 do
				obj[i]:removeSelf()
				obj[i] = nil
			end
		end
	elseif M.isDisplayObj(obj)  then
		obj:removeSelf()
		obj = nil
	end
end
return M